<template>
	<view id="domxee-content" :class="globalData.defaultThemes">
		<view id="content_wrapper">
			<view id="header_wrapper" :style="styles.header_wrapper">
				<nii-navbar :globalData="globalData" :scroll="scroll">
					<!-- <view slot="title">
						<view id="title" class="fw-bolder ZKLOGO text-dark">{{renders.title}}</view>
					</view> -->
				</nii-navbar>
				<view id="search" v-if="renders.search.enable">
					<view class="search min-padding">
						<view class="search_box d-flex justify-content-between align-items-center">
							<view class="left w-fill-available">
								<view class="search_input_box section d-flex justify-content-between align-items-center">
									<view class="domxee_icon iconfont icon-sousuo"></view>
									<view class="input w-fill-available" @click="navigateAction(renders.search.alias, renders.search.params)">{{renders.search.placeholder}}</view>
									<view @click="scanAction" class="scan domxee_icon iconfont icon-saoyisao" v-if="renders.search.scan"></view>
								</view>
							</view>
							<view class="right">
								<view class="message" @click="navigateAction('messages')">
									<view class="domxee_icon fw-bold iconfont icon-tongzhi1"></view>
									<view class="unread bg" v-if="renders.unread_message"></view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view id="banners" v-if="renders.banners.enable">
					<view class="banners">
						<view class="banners_box">
							<swiper :autoplay="true" :interval="2500" :duration="1000" class="swiper">
								<swiper-item class="swiper_box container" v-for="(banner, index) in renders.banners.lists" :key="index">
									<view class="swiper-item">
										<view class="banner_box" @click="navigateAction(banner.alias, banner.params)">
											<u--image :src="banner.img" width="100%" height="260rpx" radius="20rpx" mode="widthFix" :bgColor="globalData.colors.current.section" class="banner">
											  <template v-slot:loading>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											  <template v-slot:error>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											</u--image>
										</view>
									</view>
								</swiper-item>
							</swiper>
						</view>
					</view>
				</view>
				<!-- <view id="ensures" v-if="renders.ensures.enable">
					<view class="ensures min-padding">
						<view class="ensures_box d-flex justify-content-between align-items-center vice_text">
							<view class="item d-flex align-items-center" v-for="(ensure, index) in renders.ensures.lists" :key="index">
								<view class="img_box">
									<u--image :src="ensure.img" width="30rpx" height="30rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="img">
									  <template v-slot:loading>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									  <template v-slot:error>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									</u--image>
								</view>
								<view class="text text-dark">{{ensure.text}}</view>
							</view>
						</view>
					</view>
				</view> -->
				<view id="navigations" v-if="renders.navigations.enable">
					<view class="navigations min-padding">
						<view class="navigations_box section d-flex justify-content-between align-items-center flex-wrap">
							<view class="navigation" v-for="(navigation, index) in renders.navigations.lists" :key="index" @click="navigateAction(navigation.alias, navigation.params)">
								<view class="icon_box">
									<u--image :src="navigation.logo" width="110rpx" height="110rpx" radius="110rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="icon">
									  <template v-slot:loading>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									  <template v-slot:error>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									</u--image>
								</view>
								<view class="text text-center fw-bold">{{navigation.name}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view id="notices" v-if="renders.notices.enable">
				<view class="notices min-padding">
					<view class="notices_box section" @click="navigateAction(renders.notices.alias, renders.notices.params)">
						<u-notice-bar :text="renders.notices.text" direction="row" :step="false" :duration="1000" :color="globalData.colors.theme.color" icon="volume" bgColor="transparent" fontSize="12"></u-notice-bar>
					</view>
				</view>
			</view>
			<!-- <view id="thematic" v-if="renders.thematic.enable">
				<view class="thematic min-padding">
					<view class="thematic_box d-flex justify-content-between align-items-center">
						<view class="left section">
							<view class="title" @click="navigateAction(renders.thematic.left.alias, renders.thematic.left.params)">
								<u--image :src="renders.thematic.left.img" width="160rpx" height="48rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="tit">
								  <template v-slot:loading>
									 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
								  </template>
								  <template v-slot:error>
									 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
								  </template>
								</u--image>
							</view>
							<view class="lists">
								<view class="contents d-flex justify-content-between align-items-center flex-wrap">
									<view class="goods_cover" v-for="(good, index) in renders.thematic.left.lists" :key="index" @click="navigateAction(good.alias, good.params)">
										<u--image :src="good.cover" width="148rpx" height="148rpx" radius="10rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="cover">
										  <template v-slot:loading>
											 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
										  </template>
										  <template v-slot:error>
											 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
										  </template>
										</u--image>
									</view>
								</view>
							</view>
						</view>
						<view class="right">
							<view class="item section d-flex justify-content-between" v-for="(item, index) in renders.thematic.right" :key="index" @click="navigateAction(item.alias, item.params)">
								<view class="infos">
									<view class="title fw-bolder text-dark">{{item.title}}</view>
									<view class="desc color">{{item.desc}}</view>
								</view>
								<view class="img_box d-flex align-items-end">
									<u--image :src="item.img" width="120rpx" height="100rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="img">
									  <template v-slot:loading>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									  <template v-slot:error>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									</u--image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view> -->
			<view id="activity" v-if="renders.activity.enable">
				<view class="activity min-padding">
					<view class="activity_box" @click="navigateAction(renders.activity.alias, renders.activity.params)">
						<u--image :src="renders.activity.img" width="100%" height="240rpx" radius="20rpx" mode="widthFit" :bgColor="globalData.colors.current.section" class="image">
						  <template v-slot:loading>
							 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
						  </template>
						  <template v-slot:error>
							 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
						  </template>
						</u--image>
					</view>
				</view>
			</view>
			
			<view class="d-flex flex-wrap p-10">
				
				<view class="span-10 p-10 box-border">
					<view class="">
						<image src="../../static/images/other/1/zr.png" mode=""></image>
					</view>
					<view class="">
						<view class="line-1">
							眼葆宝压片糖果眼葆宝压片糖果
						</view>
						<view class="theme-main-color">
							商城价：¥222.00
						</view>
					</view>
				</view>
				<view class="span-10 p-10 box-border">
					<view class="">
						<image src="../../static/images/other/1/zr.png" mode=""></image>
					</view>
					<view class="">
						<view class="line-1">
							眼葆宝压片糖果眼葆宝压片糖果
						</view>
						<view class="theme-main-color">
							商城价：¥222.00
						</view>
					</view>
				</view>
				<view class="span-10 p-10 box-border">
					<view class="">
						<u--image :src="renders.activity.img" width="100%" height="240rpx" radius="20rpx" mode="widthFit" :bgColor="globalData.colors.current.section" class="image">
						  <template v-slot:loading>
							 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
						  </template>
						  <template v-slot:error>
							 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
						  </template>
						</u--image>
					</view>
					<view class="">
						<view class="line-1">
							眼葆宝压片糖果眼葆宝压片糖果
						</view>
						<view class="theme-main-color">
							商城价：¥222.00
						</view>
					</view>
				</view>
			</view>
			
			<view class="theme-main-bg-color p-20">
				<view class="d-flex j-sb a-center text-white">
					<view class="d-flex ">
						<view class="">
							热门榜单
						</view>
						<view class="font-24 ml-20 mt-5">
							根据销量、搜索、好评等综合得出
						</view>
					</view>
					<view class="d-flex font-24">
						<view class="">
							更多
						</view>
						<view class="iconfont icon-gengduo ml-10 font-24"></view>
					</view>
				</view>
				<view class="bg-white d-flex j-sb b-r16 py-20 px-10 mt-20">

						<view class="span24-8 box-border px-10">
							<view class="" style="height: 240rpx;">
								<u--image :src="renders.activity.img" width="100%" height="240rpx" radius="20rpx" mode="widthFit" :bgColor="globalData.colors.current.section" class="image">
								  <template v-slot:loading>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								  <template v-slot:error>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								</u--image>
							</view>
							<view class="">
								<view class="line-1">
									眼葆宝压片糖果眼葆宝压片糖果
								</view>
								<view class="theme-main-color">
									¥222.00
								</view>
							</view>
						</view>
						<view class="span24-8 box-border px-10">
							<view class="" style="height: 240rpx;">
								<u--image :src="renders.activity.img" width="100%" height="240rpx" radius="20rpx" mode="widthFit" :bgColor="globalData.colors.current.section" class="image">
								  <template v-slot:loading>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								  <template v-slot:error>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								</u--image>
							</view>
							<view class="">
								<view class="line-1">
									眼葆宝压片糖果眼葆宝压片糖果
								</view>
								<view class="theme-main-color">
									¥222.00
								</view>
							</view>
						</view>
						<view class="span24-8 box-border px-10">
							<view class=""  style="height: 240rpx;">
								<u--image :src="renders.activity.img" width="100%" height="240rpx" radius="20rpx" mode="widthFit" :bgColor="globalData.colors.current.section" class="image">
								  <template v-slot:loading>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								  <template v-slot:error>
									 <image src="../../static/images/other/1/zr.png" mode="aspectFit"></image>
								  </template>
								</u--image>
							</view>
							<view class="">
								<view class="line-1">
									眼葆宝压片糖果眼葆宝压片糖果
								</view>
								<view class="theme-main-color">
									¥222.00
								</view>
							</view>
						</view>
					
				</view>
			</view>
			
			<view id="brand" v-if="renders.brand.enable">
				<view class="brand min-padding">
					<view class="brand_box section">
						<view class="titles d-flex justify-content-between align-items-center">
							<view class="title fw-bolder">{{renders.brand.title}}</view>
							<view class="more color fw-bold" @click="navigateAction(renders.brand.alias, renders.brand.params)">{{renders.brand.more}}</view>
						</view>
						<view class="lists">
							<view class="good d-flex justify-content-between align-items-center" v-for="(good, index) in renders.brand.lists" :key="index" @click="navigateAction(good.alias, good.params)">
								<view class="left">
									<u--image :src="good.cover" width="200rpx" height="200rpx" radius="10rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="cover">
									  <template v-slot:loading>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									  <template v-slot:error>
										 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
									  </template>
									</u--image>
								</view>
								<view class="right w-fill-available">
									<view class="title fw-bolder u-line-2">{{good.title}}</view>
									<view :class="['tag fw-bold', good.is_subsidy === 1 ? 'ZKLOGO subsidy' : (good.tag ? 'bg' : '')]">{{good.tag}}</view>
									<view class="prices d-flex align-items-center">
										<view class="price fw-bolder color"><span>¥</span>{{(good.amount/100).toFixed(2)}}</view>
										<s class="market_price fw-bold less_text">¥ {{(good.market_amount/100).toFixed(2)}}</s>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view id="recommend" v-if="renders.recommend.enable">
				<view class="recommend min-padding">
					<view class="recommend_box section">
						<view class="titles d-flex justify-content-between align-items-center">
							<view class="title fw-bolder"><span class="domxee_icon color iconfont icon-w_huo"></span>{{renders.recommend.title}}</view>
							<view class="more color fw-bold" @click="navigateAction(renders.recommend.alias, renders.recommend.params)">{{renders.recommend.more}}</view>
						</view>
						<view class="lists">
							<scroll-view scroll-x="true" class="goods_box">
								<view class="goods d-flex align-items-center">
									<view class="good" v-for="(good, index) in renders.recommend.lists" :key="index" @click="navigateAction(good.alias, good.params)">
										<view class="cover_box">
											<u--image :src="good.cover" width="200rpx" height="200rpx" radius="10rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="cover">
											  <template v-slot:loading>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											  <template v-slot:error>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											</u--image>
										</view>
										<view class="good_title fw-bolder u-line-1">{{good.title}}</view>
										<view class="prices d-flex justify-content-between align-items-center">
											<view class="price fw-bolder color"><span>¥</span>{{(good.amount/100).toFixed(2)}}</view>
											<s class="market_price fw-bold less_text">¥ {{(good.market_amount/100).toFixed(2)}}</s>
										</view>
									</view>
								</view>
							</scroll-view>
						</view>
					</view>
				</view>
			</view>
			<view id="lists" v-if="renders.lists.enable">
				<view class="lists min-padding">
					<view class="lists_box">
						<view class="titles d-flex align-items-center">
							<view class="line bg"></view>
							<view class="title text-nowrap fw-bolder">{{renders.lists.title}}</view>
						</view>
						<view id="domxee_good_lists_v101">
							<view class="good_lists_box d-flex justify-content-between align-items-center flex-wrap">
								<view class="good" v-for="(good, index) in data.sections.goods.lists" :key="index" @click="navigateAction(good.alias, good.params)">
									<view class="good_box section">
										<view class="good_cover">
											<u--image :src="good.cover" width="346rpx" height="346rpx" radius="20rpx 20rpx 0rpx 0rpx" mode="aspectFit" :bgColor="globalData.colors.current.section" class="cover">
											  <template v-slot:loading>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											  <template v-slot:error>
												 <image src="@/static/media/images/loading.png" mode="aspectFit"></image>
											  </template>
											</u--image>
										</view>
										<view class="good_infos">
											<view class="good_title fw-bolder u-line-2">
												<span :class="['tag fw-bold', good.is_subsidy ? 'ZKLOGO subsidy' : 'bg']" v-if="good.tag">{{good.tag}}</span>{{good.title}}
											</view>
											<view class="superiorities">
												<scroll-view scroll-x="true" class="superiorities_box">
													<view class="contents d-flex align-items-center">
														<view class="item color border-color fw-bold" v-for="(superiority, s_index) in good.superiorities" :key="s_index">{{superiority}}</view>
													</view>
												</scroll-view>
											</view>
											<view class="prices">
												<view class="price fw-bolder color"><span>¥</span>{{good.price}}</view>
												<view class="bottom d-flex justify-content-between align-items-center">
													<s class="market_price fw-bold less_text">¥ {{good.market_price}}</s>
													<view class="viewer d-flex align-items-center">
														<view class="domxee_icon less_text">&#xe639;</view>
														<view class="number less_text">{{good.view_count}}</view>
													</view>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
							<view class="good_lists_loading" v-if="data.sections.goods.mode == 'loading'">
								<u-loading-icon mode="circle" :inactive-color="globalData.colors.theme.color" :textColor="globalData.colors.theme.color" :color="globalData.colors.current.vice" size="13" textSize="13" text="正在加载列表..."></u-loading-icon>
							</view>
							<view class="good_lists_finished text-center fw-bold vice_text" v-if="data.sections.goods.mode == 'finished'">— 已到底部 —</view>
							<view class="good_lists_empty text-center" v-if="data.sections.goods.mode == 'empty'">
								<view class="iconfont icon-search font-90"></view>
								<view class="text vice_text fw-bold">商品列表为空</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<u-popup :show="shows.upgrade" mode="bottom" bgColor="transparent" :safeAreaInsetBottom="false" :closeOnClickOverlay="false" @close="shows.upgrade = false">
			<view class="domxee_popup">
				<view class="section" id="upgrade_popup">
					<view class="title fw-bolder main_text">升级提醒</view>
					<view class="upgrade_box content_box main_text">
						<view class="upgrade">
							新版本 <span class="color fw-bolder">{{ renders.upgrade.version }}</span> 已发布，现邀请您立即下载新版本使用，点击下方按钮可前往下载
						</view>
						<view class="button bg text-center fw-border" @click="upgradeAction">
							立即下载
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				globalData: {windowWidth: 0, statusBarHeight: 0, navHeight: 0, navigationBarHeight: 0, wechatCapsule: {width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0}, defaultThemes: [], colors: {}, configs: {} },
				scroll: 0,
				current_page: {route: '', params: {}, url: ''},
				ready: false,
				options: {

				},
				styles: {
					header_wrapper: ''
				},
				shows: {
					upgrade: false,
				},
				renders: {
					title: '',
					unread_message: false, 
					search: {enable: false, placeholder: '', scan: false, alias: 'none', params: {}},
					banners: {enable: false, lists: [{name: '', img: '', alias: 'none', params: {}}]},
					ensures: {enable: false, lists: {}},
					navigations: {enable: false, lists: [{id: 0, name: '', logo: '', alias: 'none', params: {}}]},
					notices: {enable: false, text: '', alias: 'none', params: {}},
					thematic: {enable: false, left: {title: '', img: '', alias: 'none', params: {}, lists: [{code: '', cover: '', title: '', amount: 0, market_amount: 0, alias: 'none', params: {}}]}, right: []},
					activity: {enable: false, name: '', img: '', alias: 'none', params: {}},
					brand: {enable: false, title: '', more: '', alias: 'none', params: {}, lists: [{code: '', cover: '', title: '', amount: 0, market_amount: 0, alias: 'none', params: {}}]},
					recommend: {enable: false, title: '', more: '', alias: 'none', params: {}, lists: [{code: '', cover: '', title: '', amount: 0, market_amount: 0, alias: 'none', params: {}}]},
					lists: {enable: false, title: '', filters: {}},
					upgrade: {version: '', version_num: 0, link: ''}
				},
				data: {
					sections: {
						goods: {
							mode: 'loading',
							page: 1,
							lists: []
						}
					},
				},
			}
		},
		onReady() {						//页面渲染完毕后操作（动态获取/调整元素宽高位置等需在ready后获取最为准确）
			//设置对象
			let that = this;

		},
		onShow() {						//页面显示后操作（关闭、后台运行等操作后重新打开访问触发、可在实时性较高操作页面进行全页刷新）
			//设置对象
			let that = this;
			//判断是否准备就绪
			if (that.ready) {
				//初始数据
				that.initInformation();
			}
		},
		onLoad(options) {				//页面加载时操作（options可获取当前页面传递参数，如：options.id）
			//设置对象
			let that = this;
			//设置当前页面数据
			that.current_page = that.nii_common.pages.getCurrentUrl();
			//设置默认数据
			that.globalData = that.nii_common.pages.initGlobalData(getApp().globalData);
			//设置参数
			that.options = options;
			//设置背景颜色
			that.styles.header_wrapper = ['background: linear-gradient(175deg, #FCF2E7 0%, #FEEDED 25%, '+that.globalData.colors.current.page+' 80%)'].join(';');
			//初始数据
			that.initInformation();
		},
		methods: {
			//默认跳转操作
			navigateAction: function(alias, requestParams = {}, action = 'navigate', authenticate = false, animationType = 'slide-in-right') {this.nii_common.navigate.action(alias, requestParams, action, authenticate, animationType); },
			//拨打电话
			callPhone: function(mobile) {uni.makePhoneCall({phoneNumber: mobile});},
			//复制数据
			clipboardData: function (text) {const that = this;that.nii_common.clipboardData(text);},
			initInformation: function() {
				//设置对象
				let that = this;
				//loading
				!that.ready && that.nii_common.toastLoading('加载中');
				//开始准备
				that.ready = false;
				//发起请求
				that.nii_common.request.build('index/information', that.options, 'POST', function (res) {
					//设置准备已就绪
					that.ready = true;
					//设置信息
					that.renders = res.data;
					//刷新商品信息
					// that.getGoodLists(true);
					//停止刷新
					uni.stopPullDownRefresh();	
					// #ifdef APP
						//获取众益健康配置
						const envConfig = process.projectEnv;
						//判断信息
						if (envConfig.VERSION_NUMBER < that.renders.upgrade.version_num) {
							//提示升级
							that.shows.upgrade = true;
						}
					// #endif
				}, function (res) {
					//提示错误
					that.nii_common.toastAlert(res.msg);
				}, function(res) {
					//隐藏loading
					that.nii_common.toastLoadingHide();
				});	
			},
			getGoodLists: function(refresh = false) {
				//设置对象
				let that = this;
				//判断是否刷新列表
				if (refresh) {					
					that.data.sections.goods = {mode: 'refresh', page: 1, lists: []};	
				}
				//判断是否无追加内容
				if (that.data.sections.goods.mode !== 'finished' && that.data.sections.goods.mode !== 'empty' && that.data.sections.goods.mode !== 'loading') {				
					//设置刷新
					that.data.sections.goods.mode = 'loading';				
					//发起请求
					that.nii_common.request.build('app/goods/lists', {filters: that.renders.lists.filters, page: that.data.sections.goods.page}, 'POST', function (res) {
						//设置已激活
						that.data.sections.goods.mode = 'active';
						//判断是否无数据
						if (uni.$u.test.isEmpty(res.data.lists)) {
							//判断当前页码是否为第一页
							if (parseInt(that.data.sections.goods.page) === 1) {
								//设置数据为空
								that.data.sections.goods.mode = 'empty';
							} else {
								//设置数据已加载完毕
								that.data.sections.goods.mode = 'finished';
							}
						} else {
							//循环列表
							res.data.lists.forEach((good, index) => {
								//增加信息
								that.data.sections.goods.lists.push(good);
							});
							//判断是否为最后一页
							if (parseInt(res.data.lists.length) < parseInt(res.data.page_size)) {
								//设置数据已加载完毕
								that.data.sections.goods.mode = 'finished';
							}
						}
						//增加页码
						that.data.sections.goods.page += 1;
					}, function (res) {
						//提示错误
						that.nii_common.toastAlert(res.msg);
					}, function(res) {
						//隐藏loading
						that.nii_common.toastLoadingHide();
					});	
				}
			},
			upgradeAction: function () {
				//设置对象
				let that = this;
				//关闭弹窗
				that.shows.upgrade = false;
				//跳转链接
				plus.runtime.openURL(that.renders.upgrade.link, function (err) {
					//提示失败
					that.nii_common.toastAlert(err.errMsg);
				});
			},
			
			scanAction: function() {
				console.log(1);
				// 允许从相机和相册扫码
				uni.scanCode({
					scanType: ['qrCode'],
					onlyFromCamera: false,
					success: function (res) {
						console.log(res);
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						let url = res.result + '&type=gold';
						console.log(url);
						uni.navigateTo({
							url: url
						});
						// if(!uni.$u.test.isEmpty(res.result)){
						// 	uni.navigateTo({
						// 		url: res.result + '&type=gold'
						// 	});
						// }
					}
				});
			},
			// requestDemo: function() {
			// 	//获取对象
			// 	const that = this;
			// 	//loading
			// 	that.nii_common.toastLoading('处理中...');
			// 	//发起请求
			// 	that.nii_common.request.build('', {}, 'POST', function (res) {
			// 		//提示成功
			// 		that.nii_common.toastAlert('处理成功', 'success');
			// 	}, function (res) {
			// 		//提示错误
			// 		that.nii_common.toastAlert(res.msg);
			// 	}, function(res) {
			// 		//隐藏loading
			// 		that.nii_common.toastLoadingHide();
			// 	});	
			// }
		},
		onPullDownRefresh(res) {
			//设置对象
			let that = this;
			//重置数据
			that.initInformation();
		},
		onReachBottom() {
			//设置对象
			let that = this;
			//或许获取列表
			that.getGoodLists();
			
		},
		onPageScroll: function(e) {
			//设置页面滑动高度
			this.scroll = e.scrollTop

			//TODO：需判断滑动高度后处理的事件

		}
	}

</script>

<style lang="scss">
	#content_wrapper {
		padding-bottom: 300rpx;
		#header_wrapper {
			#title {
				font-size: 40rpx;
			}
			.domxee_icon {			
				font-size: 36rpx;
				line-height: 60rpx;
				margin-right: 20rpx;
			}
			.domxee_icon:last-child {
				margin-right: 0;
			}
			#search {
				margin-top: 20rpx;
				.search {
					.search_box {
						.left {
							margin-right: 20rpx;
							.search_input_box {
								padding: 20rpx;
								border-radius: 20rpx;
								.domxee_icon {
									font-size: 30rpx;
									line-height: 34rpx;
									margin-right: 20rpx;
									font-weight: 500;
								}
								.input {
									font-size: 24rpx;
									line-height: 34rpx;
								}
								.scan {
									margin-left: 20rpx;
									margin-right: 0;
								}
								
							}
						}
						.right {
							.message {
								position: relative;
								.domxee_icon {
									margin-right: 0;
									font-size: 36rpx;
									line-height: 34rpx;
								}
								.unread {
									position: absolute;
									top: -10rpx;
									right: -10rpx;
									width: 16rpx;
									height: 16rpx;
									border-radius: 100%;
								}
							}	
						}
					}
				}
			}
			#banners {
				margin-top: 30rpx;
				.banners {
					.banners_box {
						.swiper {
							height: 260rpx;
							.swiper_box {
								height: 260rpx;
								text-align: center;
								.swiper-item {
									height: 260rpx;
									.banner_box {
										margin: 0 auto;
										width: 710rpx;
										height: 260rpx;
										border-radius: 20rpx;
									}
								}
							}
						}
					}
				}
			}
			#ensures {
				margin-top: 30rpx;
				.ensures {
					.ensures_box {
						.item {
							.img_box {
								width: 30rpx;
								height: 30rpx;
								margin-right: 12rpx;
							}
							.text {
								font-size: 24rpx;
								line-height: 34rpx;
							}
						}
					}
				}
			}
			#navigations {
				margin-top: 30rpx;
				.navigations {
					.navigations_box {
						padding: 10rpx;
						border-radius: 20rpx;
						.navigation {
							margin: 10rpx 10rpx;
							.icon_box {
								width: 110rpx;
								height: 110rpx;
								border-radius: 20rpx;
							}
							.text {
								margin-top: 10rpx;
								width: 110rpx;
								font-size: 24rpx;
								line-height: 34rpx;
							}
						}
					}
				}
			}
		}
		#notices {
			margin-top: 30rpx;
			.notices {
				.notices_box {
					border-radius: 20rpx;
				}
			}
		}
		#thematic {
			margin-top: 30rpx;
			.thematic {
				.thematic_box {
					.left {
						background: linear-gradient(180deg, #FFEAEA 0%, #FFFFFF 100%);
						border-radius: 20rpx;
						width: 342rpx;
						height: 344rpx;
						padding: 20rpx 0 40rpx 0;
						.title {
							margin-left: 10rpx;
							width: 160rpx;
							height: 48rpx;
						}
						.lists {
							margin-left: 10rpx;
							margin-top: 10rpx;
							.contents {
								.goods_cover {
									width: 148rpx;
									height: 148rpx;
									border-radius: 10rpx;
									margin-right: 20rpx;
									margin-top: 10rpx;
								}
							}
						}
					}
					.right {
						.item {
							padding: 20rpx 10rpx 10rpx 10rpx;
							width: 342rpx;
							height: 162rpx;
							background: linear-gradient(148deg, #FFE8D7 0%, #FFFFFF 40%);
							border-radius: 20rpx;
							margin-top: 20rpx;
							.infos {
								margin-right: 20rpx;
								.title {
									font-size: 28rpx;
									line-height: 40rpx;
								}
								.desc {
									margin-top: 4rpx;
									font-size: 24rpx;
									line-height: 34rpx;
								}
							}
							.img_box {
								width: 120rpx;
								height: 162rpx;
							}
						}
						.item:first-child {
							margin-top: 0;
						}
					}
				}
			}
		}
		#activity {
			margin-top: 30rpx;
			.activity {
				.activity_box {
					width: 710rpx;
					height: 240rpx;
					border-radius: 20rpx;
				}
			}
		}
		#ad {
			margin-top: 30rpx;
		}
		#brand {
			margin-top: 30rpx;
			.brand {
				.brand_box {
					padding: 30rpx 20rpx 40rpx 20rpx;
					border-radius: 20rpx;
					.titles {
						.title {
							font-size: 36rpx;
							line-height: 50rpx;
						}
						.more {
							font-size: 24rpx;
							line-height: 34rpx;
						}
					}
					.lists {
						margin-top: 40rpx;
						.good {
							margin-top: 40rpx;
							.left {
								width: 200rpx;
								height: 200rpx;
								border-radius: 10rpx;
								margin-right: 20rpx;
							}
							.right {
								.title {
									width: 438rpx;
									height: 80rpx;
									font-size: 28rpx;
									line-height: 40rpx;
								}
								.tag {
									margin-top: 10rpx;
									padding: 0 12rpx;
									height: 40rpx;
									width: max-content;
									border-radius: 17rpx;
									font-size: 24rpx;
									line-height: 40rpx;
								}
								.subsidy {
									background: #A67E64;
									color: #FFFFFF;
								}
								.prices {
									margin-top: 20rpx;
									.price {
										margin-right: 20rpx;
										font-size: 36rpx;
										line-height: 34rpx;
										span {
											font-size: 24rpx;
											margin-right: 8rpx;
										}
									}
									.market_price {
										font-size: 24rpx;
										line-height: 34rpx;
									}
								}
							}
						}
						.good:first-child {
							margin-top: 0;
						}
					}
				}
			}
		}
		#recommend {
			margin-top: 30rpx;
			.recommend {
				.recommend_box {
					padding: 30rpx 20rpx 40rpx 20rpx;
					border-radius: 20rpx;
					.titles {
						.title {
							.domxee_icon {
								font-size: 40rpx;
								margin-right: 20rpx;
							}
							font-size: 36rpx;
							line-height: 50rpx;
						}
						.more {
							font-size: 24rpx;
							line-height: 34rpx;
						}
					}
					.lists {
						margin-top: 40rpx;
						.goods_box {
							white-space: nowrap;
							.goods {
								width: max-content;
								.good {
									margin-right: 20rpx;
									.cover_box {
										width: 200rpx;
										height: 200rpx;
										border-radius: 10rpx;
									}
									.good_title {
										white-space: normal;
										margin-top: 10rpx;
										width: 200rpx;
										height: 34rpx;
										font-size: 24rpx;
										line-height: 34rpx;
									}
									.prices {
										margin-top: 10rpx;
										.price {
											font-size: 28rpx;
											line-height: 34rpx;
											span {
												font-size: 24rpx;
												margin-right: 8rpx;
											}
										}
										.market_price {
											font-size: 24rpx;
											line-height: 34rpx;
										}
									}
								}
								.good:last-child {
									margin-right: 0;
								}
							}
						}
					}
				}
			}
		}
		#lists {
			margin-top: 30rpx;
			.lists {
				.lists_box {
					.titles {
						.line {
							margin-right: 20rpx;
							width: 10rpx;
							height: 30rpx;
						}
						.title {
							font-size: 36rpx;
							line-height: 50rpx;
						}
					}
				}
			}
		}
	}
	#upgrade_popup {
		border-radius: 20rpx 20rpx 0 0;
		.title {
			font-size: 36rpx;
			line-height: 50rpx;
		}
		.upgrade_box {
			margin-top: 20rpx;
			.upgrade {
				font-size: 28rpx;
				line-height: 40rpx;
				.color {
					margin: 0 10rpx;
				}
			}
			.button {
				margin-top: 40rpx;
				border-radius: 33rpx;
				padding: 26rpx 0;
				font-size: 26rpx;
				line-height: 36rpx;
				letter-spacing: 1rpx;
			}
		}
	}
</style>
